import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/index/models/football_ratio_entity.dart';
import 'package:flutter_deer/game/models/game_item_entity.dart';

GameItemEntity $GameItemEntityFromJson(Map<String, dynamic> json) {
  final GameItemEntity gameItemEntity = GameItemEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    gameItemEntity.id = id;
  }
  final int? specialId = jsonConvert.convert<int>(json['specialId']);
  if (specialId != null) {
    gameItemEntity.specialId = specialId;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    gameItemEntity.name = name;
  }
  final int? footballTeamOne = jsonConvert.convert<int>(json['footballTeamOne']);
  if (footballTeamOne != null) {
    gameItemEntity.footballTeamOne = footballTeamOne;
  }
  final int? footballTeamTwo = jsonConvert.convert<int>(json['footballTeamTwo']);
  if (footballTeamTwo != null) {
    gameItemEntity.footballTeamTwo = footballTeamTwo;
  }
  final String? playTime = jsonConvert.convert<String>(json['playTime']);
  if (playTime != null) {
    gameItemEntity.playTime = playTime;
  }
  final String? playDate = jsonConvert.convert<String>(json['playDate']);
  if (playDate != null) {
    gameItemEntity.playDate = playDate;
  }
  final FootballTeamEntity? teamOne = jsonConvert.convert<FootballTeamEntity>(json['teamOne']);
  if (teamOne != null) {
    gameItemEntity.teamOne = teamOne;
  }
  final FootballTeamEntity? teamTwo = jsonConvert.convert<FootballTeamEntity>(json['teamTwo']);
  if (teamOne != null) {
    gameItemEntity.teamTwo = teamTwo;
  }
  final String? teamOneName = jsonConvert.convert<String>(json['teamOneName']);
  if (teamOneName != null) {
    gameItemEntity.teamOneName = teamOneName;
  }
  final String? competitionResult = jsonConvert.convert<String>(json['competitionResult']);
  if (competitionResult != null) {
    gameItemEntity.competitionResult = competitionResult;
  }
  final int? teamOneScoreResult = jsonConvert.convert<int>(json['teamOneScoreResult']);
  if (teamOneScoreResult != null) {
    gameItemEntity.teamOneScoreResult = teamOneScoreResult;
  }
  final int? teamTwoScoreResult = jsonConvert.convert<int>(json['teamTwoScoreResult']);
  if (teamTwoScoreResult != null) {
    gameItemEntity.teamTwoScoreResult = teamTwoScoreResult;
  }
  final String? teamTwoName = jsonConvert.convert<String>(json['teamTwoName']);
  if (teamTwoName != null) {
    gameItemEntity.teamTwoName = teamTwoName;
  }
  return gameItemEntity;
}

Map<String, dynamic> $GameItemEntityToJson(GameItemEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['specialId'] = entity.specialId;
  data['name'] = entity.name;
  data['footballTeamOne'] = entity.footballTeamOne;
  data['footballTeamTwo'] = entity.footballTeamTwo;
  data['playTime'] = entity.playTime;
  data['playDate'] = entity.playDate;
  data['teamOne'] = entity.teamOne;
  data['teamTwo'] = entity.teamTwo;
  data['teamOneName'] = entity.teamOneName;
  data['teamTwoName'] = entity.teamTwoName;
  data['competitionResult'] = entity.competitionResult;
  data['teamOneScoreResult'] = entity.teamOneScoreResult;
  data['teamTwoScoreResult'] = entity.teamTwoScoreResult;
  return data;
}

GameItemPageEntity $GameItemPageEntityFromJson(Map<String, dynamic> json) {
  final GameItemPageEntity pageEntity = GameItemPageEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    pageEntity.total = total;
  }
  final int? size = jsonConvert.convert<int>(json['size']);
  if (size != null) {
    pageEntity.size = size;
  }
  final int? current = jsonConvert.convert<int>(json['current']);
  if (current != null) {
    pageEntity.current = current;
  }
  final int? pages = jsonConvert.convert<int>(json['pages']);
  if (pages != null) {
    pageEntity.pages = pages;
  }
  final List<GameItemEntity>? records = jsonConvert.convert<List<GameItemEntity>>(json['records']);
  if (records != null) {
    pageEntity.records = records;
  }
  return pageEntity;
}

Map<String, dynamic> $GameItemPageEntityToJson(GameItemPageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['size'] = entity.size;
  data['current'] = entity.current;
  data['pages'] = entity.pages;
  data['records'] = entity.records;
  return data;
}